<template>
  <div class="app-container">
    <!-- 页面头部 -->
    <div class="page-header">
      <el-card class="header-card" shadow="never">
        <div class="header-content">
          <div class="header-left">
            <div class="header-icon">
              <el-icon><Bell /></el-icon>
            </div>
            <div class="header-info">
              <h1>公告管理</h1>
              <p>管理系统公告和社团公告的发布与维护</p>
            </div>
          </div>
          <div class="header-stats">
            <el-icon class="stats-icon"><Document /></el-icon>
            <span class="stats-text">总公告数: {{ total }}</span>
          </div>
        </div>
      </el-card>
    </div>

    <!-- 搜索区域 -->
    <div class="search-container" v-show="showSearch">
      <el-card class="search-card" shadow="never">
        <el-form :model="queryParams" ref="queryForm" class="search-form">
          <el-row :gutter="20">
            <el-col :span="6">
              <el-form-item label="公告标题" prop="title">
                <el-input
                  v-model="queryParams.title"
                  placeholder="请输入公告标题"
                  clearable
                  prefix-icon="Search"
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="公告类型" prop="isGlobal">
                <el-select v-model="queryParams.isGlobal" placeholder="请选择公告类型" clearable>
                  <el-option label="系统公告" value="1" />
                  <el-option label="社团公告" value="0" />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="发布时间" prop="createdAt">
                <el-date-picker 
                  clearable
                  v-model="queryParams.createdAt"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="请选择发布时间"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item>
                <div class="search-buttons">
                  <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
                  <el-button icon="Refresh" @click="resetQuery">重置</el-button>
                </div>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-card>
    </div>

    <!-- 操作按钮区域 -->
    <div class="action-container">
      <el-card class="action-card" shadow="never">
        <div class="action-content">
          <div class="action-buttons">
            <el-button
              type="primary"
              class="action-btn primary-btn"
              icon="Plus"
              @click="handleAdd"
              v-hasPermi="['system:announcements:add']"
            >发布公告</el-button>
            <el-button
              type="success"
              class="action-btn"
              icon="Edit"
              :disabled="single"
              @click="handleUpdate"
              v-hasPermi="['system:announcements:edit']"
            >修改</el-button>
            <el-button
              type="danger"
              class="action-btn"
              icon="Delete"
              :disabled="multiple"
              @click="handleDelete"
              v-hasPermi="['system:announcements:remove']"
            >批量删除</el-button>
            <el-button
              type="warning"
              class="action-btn"
              icon="Download"
              @click="handleExport"
              v-hasPermi="['system:announcements:export']"
            >导出数据</el-button>
          </div>
          <div class="toolbar-container">
            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
          </div>
        </div>
      </el-card>
    </div>

    <!-- 公告列表 -->
    <div class="table-container">
      <el-card class="table-card" shadow="never">
        <el-table 
          v-loading="loading" 
          :data="announcementsList" 
          @selection-change="handleSelectionChange"
          class="modern-table"
          header-row-class-name="table-header"
        >
          <el-table-column type="selection" width="55" align="center" />
          
          <!-- 公告信息 -->
          <el-table-column label="公告信息" min-width="300">
            <template #default="scope">
              <div class="announcement-info">
                <div class="announcement-header">
                  <el-icon class="announcement-icon"><Bell /></el-icon>
                  <span class="announcement-title">{{ scope.row.title }}</span>
                  <el-tag 
                    :type="scope.row.isGlobal === '1' ? 'danger' : 'primary'" 
                    size="small" 
                    class="type-tag"
                  >
                    {{ scope.row.isGlobal === '1' ? '系统公告' : '社团公告' }}
                  </el-tag>
                </div>
                <div class="announcement-content">
                  <span class="content-text">{{ scope.row.content }}</span>
                </div>
                <div class="announcement-meta">
                  <span class="meta-item">
                    <el-icon><User /></el-icon>
                    发布者: {{ scope.row.publisherId }}
                  </span>
                </div>
              </div>
            </template>
          </el-table-column>

          <!-- 状态信息 -->
          <el-table-column label="状态" align="center" width="120">
            <template #default="scope">
              <div class="status-info">
                <el-tag 
                  :type="scope.row.status === '1' ? 'success' : 'info'" 
                  class="status-tag"
                >
                  <el-icon><Check v-if="scope.row.status === '1'" /><Close v-else /></el-icon>
                  {{ scope.row.status === '1' ? '显示' : '隐藏' }}
                </el-tag>
              </div>
            </template>
          </el-table-column>

          <!-- 时间信息 -->
          <el-table-column label="时间信息" align="center" width="200">
            <template #default="scope">
              <div class="time-info">
                <div class="time-item">
                  <el-icon class="time-icon"><Calendar /></el-icon>
                  <span class="time-label">发布:</span>
                  <span class="time-value">{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
                </div>
                <div class="time-item" v-if="scope.row.updatedAt">
                  <el-icon class="time-icon"><Clock /></el-icon>
                  <span class="time-label">更新:</span>
                  <span class="time-value">{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
                </div>
              </div>
            </template>
          </el-table-column>

          <!-- 操作列 -->
          <el-table-column label="操作" align="center" width="150">
            <template #default="scope">
              <div class="action-buttons">
                <el-button
                  type="primary"
                  size="small"
                  icon="Edit"
                  @click="handleUpdate(scope.row)"
                  v-hasPermi="['system:announcements:edit']"
                  class="table-action-btn"
                >修改</el-button>
                <el-button
                  type="danger"
                  size="small"
                  icon="Delete"
                  @click="handleDelete(scope.row)"
                  v-hasPermi="['system:announcements:remove']"
                  class="table-action-btn"
                >删除</el-button>
              </div>
            </template>
          </el-table-column>
        </el-table>
      </el-card>
    </div>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改系统公告对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="公告标题" prop="title">
          <el-input v-model="form.title" placeholder="请输入公告标题" />
        </el-form-item>
        <el-form-item label="公告内容">
          <editor v-model="form.content" :min-height="192"/>
        </el-form-item>
        <el-form-item label="发布者ID" prop="publisherId">
          <el-input v-model="form.publisherId" placeholder="请输入发布者ID" />
        </el-form-item>
        <el-form-item label="是否全局公告：0-社团公告, 1-系统公告" prop="isGlobal">
          <el-input v-model="form.isGlobal" placeholder="请输入是否全局公告：0-社团公告, 1-系统公告" />
        </el-form-item>
        <el-form-item label="关联社团ID" prop="clubId">
          <el-input v-model="form.clubId" placeholder="请输入关联社团ID" />
        </el-form-item>
        <el-form-item label="发布时间" prop="createdAt">
          <el-date-picker clearable
            v-model="form.createdAt"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择发布时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="更新时间" prop="updatedAt">
          <el-date-picker clearable
            v-model="form.updatedAt"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择更新时间">
          </el-date-picker>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listAnnouncements, getAnnouncements, delAnnouncements, addAnnouncements, updateAnnouncements } from "@/api/system/announcements"
import { Bell, Document, Search, Refresh, Plus, Edit, Delete, Download, User, OfficeBuilding, Check, Close, Calendar, Clock } from '@element-plus/icons-vue'

export default {
  name: "Announcements",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 系统公告表格数据
      announcementsList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        title: null,
        content: null,
        publisherId: null,
        isGlobal: null,
        clubId: null,
        status: null,
        createdAt: null,
        updatedAt: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        title: [
          { required: true, message: "公告标题不能为空", trigger: "blur" }
        ],
        content: [
          { required: true, message: "公告内容不能为空", trigger: "blur" }
        ],
        publisherId: [
          { required: true, message: "发布者ID不能为空", trigger: "blur" }
        ],
      }
    }
  },
  created() {
    this.getList()
  },
  methods: {
    /** 查询系统公告列表 */
    getList() {
      this.loading = true
      listAnnouncements(this.queryParams).then(response => {
        this.announcementsList = response.rows
        this.total = response.total
        this.loading = false
      })
    },
    // 取消按钮
    cancel() {
      this.open = false
      this.reset()
    },
    // 表单重置
    reset() {
      this.form = {
        announcementId: null,
        title: null,
        content: null,
        publisherId: null,
        isGlobal: null,
        clubId: null,
        status: null,
        createdAt: null,
        updatedAt: null
      }
      this.resetForm("form")
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm")
      this.handleQuery()
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.announcementId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset()
      this.open = true
      this.title = "添加系统公告"
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset()
      const announcementId = row.announcementId || this.ids
      getAnnouncements(announcementId).then(response => {
        this.form = response.data
        this.open = true
        this.title = "修改系统公告"
      })
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.announcementId != null) {
            updateAnnouncements(this.form).then(response => {
              this.$modal.msgSuccess("修改成功")
              this.open = false
              this.getList()
            })
          } else {
            addAnnouncements(this.form).then(response => {
              this.$modal.msgSuccess("新增成功")
              this.open = false
              this.getList()
            })
          }
        }
      })
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const announcementIds = row.announcementId || this.ids
      this.$modal.confirm('是否确认删除系统公告编号为"' + announcementIds + '"的数据项？').then(function() {
        return delAnnouncements(announcementIds)
      }).then(() => {
        this.getList()
        this.$modal.msgSuccess("删除成功")
      }).catch(() => {})
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/announcements/export', {
        ...this.queryParams
      }, `announcements_${new Date().getTime()}.xlsx`)
    }
  },
  components: {
    Bell, Document, Search, Refresh, Plus, Edit, Delete, Download, User, OfficeBuilding, Check, Close, Calendar, Clock
  }
}
</script>

<style lang="scss" scoped>
.app-container {
  padding: 24px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: auto;
  position: relative;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.1;
    border-radius: 0 0 50px 50px;
    z-index: 0;
  }
  
  > * {
    position: relative;
    z-index: 1;
  }
}

// 页面头部样式
.page-header {
  margin-bottom: 24px;
  
  .header-card {
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    }
    
    .header-content {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px;
      
      .header-left {
        display: flex;
        align-items: center;
        
        .header-icon {
          width: 70px;
          height: 70px;
          background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
          border-radius: 20px;
          display: flex;
          align-items: center;
          justify-content: center;
          margin-right: 20px;
          box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
          transition: all 0.3s ease;
          
          &:hover {
            transform: scale(1.05) rotate(5deg);
            box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
          }
          
          .el-icon {
            font-size: 28px;
            color: white;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
          }
        }
        
        .header-info {
          h1 {
            margin: 0 0 6px 0;
            font-size: 28px;
            font-weight: 700;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
          }
          
          p {
            margin: 0;
            color: #7f8c8d;
            font-size: 15px;
            font-weight: 500;
          }
        }
      }
      
      .header-stats {
        display: flex;
        align-items: center;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 16px 24px;
        border-radius: 15px;
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
        transition: all 0.3s ease;
        
        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
        }
        
        .stats-icon {
          font-size: 20px;
          margin-right: 10px;
          filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
        }
        
        .stats-text {
          font-weight: 600;
          font-size: 16px;
        }
      }
    }
  }
}

// 搜索区域样式
.search-container {
  margin-bottom: 24px;
  
  .search-card {
    border: none;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }
    
    .search-form {
      .el-form-item {
        margin-bottom: 0;
        
        .el-form-item__label {
          font-weight: 600;
          color: #2c3e50;
          font-size: 14px;
        }
        
        .el-input, .el-select {
          .el-input__inner, .el-select__input {
            border-radius: 12px;
            border: 2px solid #f0f2f5;
            transition: all 0.3s ease;
            background: rgba(255, 255, 255, 0.8);
            
            &:focus {
              border-color: #667eea;
              box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
              background: white;
              transform: translateY(-1px);
            }
            
            &:hover {
              border-color: #d0d7de;
              background: white;
            }
          }
        }
        
        .el-date-editor {
          .el-input__inner {
            border-radius: 12px;
            border: 2px solid #f0f2f5;
            transition: all 0.3s ease;
            background: rgba(255, 255, 255, 0.8);
            
            &:focus {
              border-color: #667eea;
              box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
              background: white;
              transform: translateY(-1px);
            }
          }
        }
      }
      
      .search-buttons {
        display: flex;
        gap: 12px;
        
        .el-button {
          border-radius: 12px;
          padding: 12px 24px;
          font-weight: 600;
          transition: all 0.3s ease;
          border: 2px solid transparent;
          
          &.el-button--primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            color: white;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
            
            &:hover {
              transform: translateY(-3px);
              box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
            }
            
            &:active {
              transform: translateY(-1px);
            }
          }
          
          &:not(.el-button--primary) {
            background: white;
            border-color: #e4e7ed;
            color: #606266;
            
            &:hover {
              border-color: #667eea;
              color: #667eea;
              transform: translateY(-2px);
              box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
            }
          }
        }
      }
    }
  }
}

// 操作按钮区域样式
.action-container {
  margin-bottom: 24px;
  
  .action-card {
    border: none;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }
    
    .action-content {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px;
      
      .action-buttons {
        display: flex;
        gap: 16px;
        
        .action-btn {
          border-radius: 12px;
          padding: 12px 24px;
          font-weight: 600;
          transition: all 0.3s ease;
          border: 2px solid transparent;
          position: relative;
          overflow: hidden;
          
          &::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s;
          }
          
          &:hover::before {
            left: 100%;
          }
          
          &.primary-btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
            
            &:hover {
              transform: translateY(-3px) scale(1.02);
              box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
            }
          }
          
          &.el-button--success {
            background: linear-gradient(135deg, #67c23a 0%, #85ce61 100%);
            border: none;
            color: white;
            box-shadow: 0 4px 15px rgba(103, 194, 58, 0.3);
            
            &:hover {
              transform: translateY(-3px) scale(1.02);
              box-shadow: 0 8px 25px rgba(103, 194, 58, 0.4);
            }
          }
          
          &.el-button--danger {
            background: linear-gradient(135deg, #f56c6c 0%, #f78989 100%);
            border: none;
            color: white;
            box-shadow: 0 4px 15px rgba(245, 108, 108, 0.3);
            
            &:hover {
              transform: translateY(-3px) scale(1.02);
              box-shadow: 0 8px 25px rgba(245, 108, 108, 0.4);
            }
          }
          
          &.el-button--warning {
            background: linear-gradient(135deg, #e6a23c 0%, #ebb563 100%);
            border: none;
            color: white;
            box-shadow: 0 4px 15px rgba(230, 162, 60, 0.3);
            
            &:hover {
              transform: translateY(-3px) scale(1.02);
              box-shadow: 0 8px 25px rgba(230, 162, 60, 0.4);
            }
          }
          
          &:disabled {
            opacity: 0.6;
            transform: none !important;
            box-shadow: none !important;
            cursor: not-allowed;
          }
        }
      }
      
      // 工具栏容器样式
      .toolbar-container {
        display: flex;
        align-items: center;
        margin-left: 20px;
        
        :deep(.right-toolbar) {
          .toolbar-item {
            margin-left: 10px;
            padding: 10px;
            border-radius: 10px;
            transition: all 0.3s ease;
            cursor: pointer;
            background: rgba(102, 126, 234, 0.1);
            
            &:hover {
              background: rgba(102, 126, 234, 0.2);
              transform: translateY(-2px) scale(1.1);
              box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
            }
            
            .el-icon {
              font-size: 18px;
              color: #667eea;
              transition: all 0.3s ease;
            }
          }
        }
      }
    }
  }
}

// 表格样式
.table-container {
  .table-card {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    }
    
    .modern-table {
      border-radius: 20px;
      overflow: hidden;
      
      .table-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        position: relative;
        
        &::before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.1) 75%);
          background-size: 20px 20px;
          animation: move 2s linear infinite;
        }
        
        th {
          background: transparent !important;
          color: white !important;
          font-weight: 700;
          border: none;
          padding: 20px 16px;
          font-size: 15px;
          text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
          position: relative;
          z-index: 1;
        }
      }
      
      .el-table__body {
        tr {
          transition: all 0.4s ease;
          position: relative;
          
          &:nth-child(even) {
            background-color: rgba(102, 126, 234, 0.02);
          }
          
          &:hover {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%) !important;
            transform: translateY(-2px) scale(1.01);
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
            z-index: 10;
            
            td {
              border-bottom-color: rgba(102, 126, 234, 0.2);
            }
          }
          
          td {
            border: none;
            padding: 20px 16px;
            border-bottom: 2px solid #f8f9fa;
            transition: all 0.3s ease;
            background: transparent;
          }
        }
      }
    }
  }
}

@keyframes move {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 20px;
  }
}

// 公告信息样式
.announcement-info {
  .announcement-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    
    .announcement-icon {
      font-size: 18px;
      color: #667eea;
      margin-right: 10px;
      background: rgba(102, 126, 234, 0.1);
      padding: 6px;
      border-radius: 8px;
      transition: all 0.3s ease;
      
      &:hover {
        background: rgba(102, 126, 234, 0.2);
        transform: scale(1.1);
      }
    }
    
    .announcement-title {
      font-weight: 700;
      color: #2c3e50;
      margin-right: 12px;
      flex: 1;
      font-size: 16px;
      line-height: 1.4;
      transition: all 0.3s ease;
      
      &:hover {
        color: #667eea;
      }
    }
    
    .type-tag {
      border-radius: 15px;
      font-size: 12px;
      font-weight: 600;
      padding: 4px 12px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      transition: all 0.3s ease;
      
      &:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      }
    }
  }
  
  .announcement-content {
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.03);
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    
    &:hover {
      background: rgba(102, 126, 234, 0.06);
      transform: translateX(2px);
    }
    
    .content-text {
      color: #606266;
      font-size: 14px;
      line-height: 1.6;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
      font-weight: 500;
    }
  }
  
  .announcement-meta {
    display: flex;
    gap: 20px;
    
    .meta-item {
      display: flex;
      align-items: center;
      font-size: 13px;
      color: #909399;
      background: rgba(144, 147, 153, 0.1);
      padding: 6px 10px;
      border-radius: 8px;
      transition: all 0.3s ease;
      
      &:hover {
        background: rgba(144, 147, 153, 0.2);
        color: #606266;
        transform: translateY(-1px);
      }
      
      .el-icon {
        font-size: 14px;
        margin-right: 6px;
      }
    }
  }
}

// 状态信息样式
.status-info {
  .status-tag {
    border-radius: 15px;
    padding: 8px 16px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    
    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
      transition: left 0.6s;
    }
    
    &:hover {
      transform: translateY(-2px) scale(1.05);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
      
      &::before {
        left: 100%;
      }
    }
    
    .el-icon {
      margin-right: 6px;
      font-size: 14px;
    }
  }
}

// 时间信息样式
.time-info {
  background: rgba(102, 126, 234, 0.03);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
  
  &:hover {
    background: rgba(102, 126, 234, 0.06);
    border-color: rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
  }
  
  .time-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    
    &:last-child {
      margin-bottom: 0;
    }
    
    &:hover {
      background: rgba(102, 126, 234, 0.08);
      transform: translateX(2px);
    }
    
    .time-icon {
      font-size: 16px;
      color: #667eea;
      margin-right: 8px;
      background: rgba(102, 126, 234, 0.1);
      padding: 4px;
      border-radius: 6px;
    }
    
    .time-label {
      color: #909399;
      margin-right: 6px;
      min-width: 36px;
      font-weight: 600;
    }
    
    .time-value {
      color: #2c3e50;
      font-weight: 600;
      background: rgba(255, 255, 255, 0.8);
      padding: 2px 8px;
      border-radius: 6px;
    }
  }
}

// 操作按钮样式
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  
  .table-action-btn {
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    
    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
      transition: left 0.5s;
    }
    
    &:hover {
      transform: translateY(-2px) scale(1.05);
      box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
      
      &::before {
        left: 100%;
      }
    }
    
    &.el-button--primary {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      border: none;
      
      &:hover {
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
      }
    }
    
    &.el-button--danger {
      background: linear-gradient(135deg, #f56c6c 0%, #f78989 100%);
      color: white;
      border: none;
      
      &:hover {
        box-shadow: 0 6px 20px rgba(245, 108, 108, 0.4);
      }
    }
  }
}

// 分页组件样式
:deep(.el-pagination) {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
  
  .el-pagination__total {
    color: #2c3e50;
    font-weight: 600;
  }
  
  .btn-prev, .btn-next {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
    }
    
    &:disabled {
      background: #e4e7ed;
      color: #c0c4cc;
      transform: none;
      box-shadow: none;
    }
  }
  
  .el-pager {
    li {
      background: white;
      border: 2px solid #f0f2f5;
      border-radius: 8px;
      margin: 0 4px;
      transition: all 0.3s ease;
      font-weight: 600;
      
      &:hover {
        border-color: #667eea;
        color: #667eea;
        transform: translateY(-1px);
      }
      
      &.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-color: transparent;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
      }
    }
  }
  
  .el-pagination__sizes {
    .el-select {
      .el-input {
        .el-input__inner {
          border-radius: 8px;
          border: 2px solid #f0f2f5;
          transition: all 0.3s ease;
          
          &:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
          }
        }
      }
    }
  }
  
  .el-pagination__jump {
    color: #2c3e50;
    font-weight: 600;
    
    .el-input {
      .el-input__inner {
        border-radius: 8px;
        border: 2px solid #f0f2f5;
        transition: all 0.3s ease;
        text-align: center;
        font-weight: 600;
        
        &:focus {
          border-color: #667eea;
          box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
        }
      }
    }
  }
}

// 对话框样式优化
:deep(.el-dialog) {
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  
  .el-dialog__header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    
    .el-dialog__title {
      font-weight: 700;
      font-size: 18px;
    }
    
    .el-dialog__close {
      color: white;
      font-size: 20px;
      
      &:hover {
        color: rgba(255, 255, 255, 0.8);
      }
    }
  }
  
  .el-dialog__body {
    padding: 24px;
    
    .el-form {
      .el-form-item {
        margin-bottom: 20px;
        
        .el-form-item__label {
          font-weight: 600;
          color: #2c3e50;
        }
        
        .el-input, .el-select, .el-date-editor {
          .el-input__inner {
            border-radius: 10px;
            border: 2px solid #f0f2f5;
            transition: all 0.3s ease;
            
            &:focus {
              border-color: #667eea;
              box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
            }
          }
        }
      }
    }
  }
  
  .el-dialog__footer {
    padding: 20px 24px;
    background: #f8f9fa;
    
    .el-button {
      border-radius: 10px;
      padding: 10px 20px;
      font-weight: 600;
      transition: all 0.3s ease;
      
      &.el-button--primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        
        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
        }
      }
    }
  }
}

// 响应式设计
@media (max-width: 1200px) {
  .header-content {
    .header-stats {
      padding: 12px 16px;
      
      .stats-text {
        font-size: 14px;
      }
    }
  }
  
  .action-buttons {
    gap: 12px;
    
    .action-btn {
      padding: 10px 18px;
      font-size: 13px;
    }
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 16px;
    
    &::before {
      height: 150px;
    }
  }
  
  .page-header {
    margin-bottom: 20px;
    
    .header-card {
      .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        
        .header-left {
          flex-direction: column;
          text-align: center;
          
          .header-icon {
            width: 60px;
            height: 60px;
            margin: 0 auto 16px;
            
            .el-icon {
              font-size: 24px;
            }
          }
          
          .header-info {
            h1 {
              font-size: 24px;
            }
          }
        }
        
        .header-stats {
          width: 100%;
          justify-content: center;
        }
      }
    }
  }
  
  .search-container {
    .search-form {
      .el-row {
        .el-col {
          margin-bottom: 16px;
          
          &:last-child {
            margin-bottom: 0;
          }
        }
      }
      
      .search-buttons {
        justify-content: center;
        
        .el-button {
          flex: 1;
          max-width: 120px;
        }
      }
    }
  }
  
  .action-container {
    .action-content {
      flex-direction: column;
      gap: 16px;
      
      .action-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        
        .action-btn {
          padding: 10px 16px;
          font-size: 12px;
          min-width: 100px;
        }
      }
      
      .toolbar-container {
        margin-left: 0;
        justify-content: center;
      }
    }
  }
  
  .table-container {
    .modern-table {
      font-size: 12px;
      
      .announcement-info {
        .announcement-header {
          flex-direction: column;
          align-items: flex-start;
          gap: 8px;
          
          .announcement-title {
            font-size: 14px;
            margin-right: 0;
          }
        }
        
        .announcement-content {
          .content-text {
            font-size: 12px;
            -webkit-line-clamp: 2;
          }
        }
        
        .announcement-meta {
          flex-direction: column;
          gap: 8px;
        }
      }
      
      .time-info {
        padding: 8px;
        
        .time-item {
          font-size: 11px;
          
          .time-label {
            min-width: 30px;
          }
        }
      }
      
      .action-buttons {
        .table-action-btn {
          padding: 6px 12px;
          font-size: 11px;
        }
      }
    }
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: 12px;
  }
  
  .page-header {
    .header-card {
      .header-content {
        .header-left {
          .header-icon {
            width: 50px;
            height: 50px;
            
            .el-icon {
              font-size: 20px;
            }
          }
          
          .header-info {
            h1 {
              font-size: 20px;
            }
            
            p {
              font-size: 13px;
            }
          }
        }
      }
    }
  }
  
  .search-container, .action-container {
    margin-bottom: 16px;
  }
  
  .table-container {
    .table-card {
      border-radius: 12px;
      
      .modern-table {
        .table-header {
          th {
            padding: 12px 8px;
            font-size: 12px;
          }
        }
        
        .el-table__body {
          tr {
            td {
              padding: 12px 8px;
            }
          }
        }
      }
    }
  }
}
</style>
